class Coin extends Sprite {
  constructor(type) {
    if (type > 2 || type < 1) {
      throw new Error('金币的类型不对，范围为1到2。');
    }

    let cointData = __g_resources.coin[`coinAni${type}`];
    super({
      image:      cointData.image,
      sx:         cointData.frame.x,
      sy:         cointData.frame.y,
      w:          cointData.frame.w,
      h:          cointData.frame.h,
      max_frame:  10,
      max_tick:   6
    });
  }
}
